// 引入axios
import axios from 'axios'
// 发送get请求 获取数据
async function getData(payload){
    let res = await axios({
        url:'/api/'+ payload.type,
        params: payload.params
    })
    return res
}

// 发送post请求
async function postData(payload){
    let res = await axios({
        url:'/api/' + payload.type,
        method: 'post',
        data:payload.data
    })
    return res
}

export {
    getData
}